<?php
include_once "../header1.php";
?>
</head>
<body>

<?php
include_once ("$basedir"."/Login/databaseconnection.php");

if(!loggedin())
{
	require_once ("$basedir"."/index.php");
}
   else
   {

	if(isset($_POST['Register']))
{
require_once 'accsett.php';
}

?>
<?php
include_once "../header2.php";
?>
	<li><a href="<?php echo "$basedir";?>/index.php" class="active"><font color="#CCCC66" style="text-shadow:#969" size="+1">Home</font></a></li>
				<li><a href="<?php echo "$basedir";?>/Schools/Schools.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Schools</font></a>
               
          </li>
				<li><a href="#"><font color="#CCCC66" style="text-shadow:#969" size="+1">Teachers</font></a>
                <ul>

            <li><a href="<?php echo "$basedir";?>/Teachers/teachers.php"><font color="#CCCC66" style="text-shadow:#969" size="2">School Teachers</font></a></li>
            <li><a href="<?php echo "$basedir";?>/"><font color="#CCCC66" style="text-shadow:#969" size="2">Resource Person</font></a></li>
          </ul></li>
				<li><a href="<?php echo "$basedir";?>/Lab/Labs.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Labs</font></a></li>
				<li><a href="<?php echo "$basedir";?>/Resources/Resources.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Resources</font></a></li>
                <li><a href="<?php echo "$basedir";?>/Exams/Exams.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Exams</font></a></li>
                         <li><a href="<?php echo "$basedir";?>/Programmes/Programmes.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Programmes</font></a></li>
                                  <li><a href="<?php echo "$basedir";?>/Competition/Competition.php"><font color="#CCCC66" style="text-shadow:#969" size="+1">Competitions</font></a></li>
               <li><a href="#"><font color="#CCCC66" style="text-shadow:#969" size="4">Settings</font></a>
                <ul>
                 <li><a href="<?php echo "$basedir";?>/Login/AccountSettings.php"><font color="#CCCC66" style="text-shadow:#969" size="2"><strong>Account Settings</strong></font></a></li>
            <li><a href="<?php echo "$basedir";?>/Login/PrivacySetting.php"><font color="#CCCC66" style="text-shadow:#969" size="2"><strong>Privacy Settings</strong></font></a></li>
            
          </ul></li>
			</ul>
	</div>
  </div>
<div class="left">
  
<div class="articles">
    <br/>
  <?php
	$succ=$_SESSION['success'];
	if($succ=="succ")
	{
   	unset($_SESSION['success']);
  echo '<form action="../index.php" method="POST">';
	}
	else
	{
		echo '<form action="#" method="POST">';
	}
  ?>
  <table width="900" height="231" border="0" class="tablefontv">
    <tr>
      <th height="18" colspan="3"  scope="row"><?php
		if(isset($_POST['Register']))
{
	if(isset($_SESSION['errorin']))
	{
		echo $_SESSION['errorin'];
		unset($_SESSION['errorin']);
	}
	if(isset($_SESSION['error']))
	{
		echo $_SESSION['error'];
		unset($_SESSION['error']);
		
	}
}
		?></th>
      <td width="217" rowspan="11">&nbsp;</td>
    </tr>
    <tr>
      <th width="187" height="30"  scope="row">
        
        
        First Name:</th>
      <td width="180">
      <?php
	  $Username=$_SESSION['username'];
	  $getuser=mysql_query("SELECT * FROM user WHERE Login_Username='$Username'");
	  if($rowuser=mysql_fetch_array($getuser))
	  {
	  $Fir_N=$rowuser['First_Name'];
	  $Las_N=$rowuser['Last_Name'];
	  $NIC_Nu=$rowuser['NIC_Number'];
	  $Ac_Type=$rowuser['Access_Type'];
	  $E_mail=$rowuser['E_Mail'];
	  }
	  
	  if(!isset($_POST['Register']))
	  {
	    if(isset($Fir_N))
	  
{
     echo "<input type='text' name='First_Name' value='$Fir_N' />";
}
}
	  if(isset($_POST['Register']))
	  {
	   $F_N=$First_Name;
	   if(isset($F_N))
	  
{
     echo "<input type='text' name='First_Name' value='$F_N' />";
}
else
{
	echo "<input type='text' name='First_Name'/>";
}
	  }
	 /* else
{
	echo "<input type='text' name='First_Name'/>";
}*/
      ?>
      </td>
      <td width="292">&nbsp;</td>
      </tr>
    <tr>
      <th height="24" scope="row">Last Name:</th>
      <td>
      <?php
	  if(!isset($_POST['Register']))
	  {
	  if(isset($Las_N))
	  
{
      echo "<input type='text' name='Last_Name' value='$Las_N' />";
}
}
	  
	   if(isset($_POST['Register']))
	  {
	 $L_N=$Last_Name;
	  if(isset($L_N))
	  
{
      echo "<input type='text' name='Last_Name' value='$L_N' />";
}
else
	  
{
      echo "<input type='text' name='Last_Name' />";
}
	  }
	 /* else
	  
{
      echo "<input type='text' name='Last_Name' />";
}
	  */?></td>
      <td>&nbsp;</td>
      </tr>
    <tr>
      <th height="31" scope="row">NIC Number :</th>
      <td>
       <?php
	    if(!isset($_POST['Register']))
	  {
	   if(isset($NIC_Nu))
	  
{
      echo "<input type='text' name='NIC_Number' value='$NIC_Nu' />";
}
}
	   if(isset($_POST['Register']))
	  {
	 $NIC=$NIC_Number;
	  if(isset($NIC))
	  
{
      echo "<input type='text' name='NIC_Number' value='$NIC' />";
}
else
	  
{
      echo "<input type='text' name='NIC_Number' />";
}
	  }
	 /* else
	  
{
      echo "<input type='text' name='NIC_Number' />";
}*/
	  ?></td>
      <td>&nbsp;</td>
      </tr>
	   <tr>
      <th height="31" scope="row">Access Type:</th>
      <td>
	  <select name="Access_Type" id="select">
       <?php
	   	  if(!isset($_POST['Register']))
	  {
	   echo '<option value="'.$Ac_Type.'">'.$Ac_Type.'</option>';
	   if($Ac_Type=="Teacher")
		  {echo '<option value="Administrator">Administrator</option>';}
	     if($Ac_Type=="Administrator")
		  {echo '<option value="Teacher">Teacher</option>';}
		}
	  if(isset($_POST['Register']))
	  {
		   if($Access_Type=="Select One")
		  {
			  echo '<option value="Select One">Select One</option>';
	   echo '<option value="Administrator">Administrator</option>';
	     echo '<option value="Teacher">Teacher</option>';
		  }
		  
		  if($Access_Type=="Teacher")
		  {echo '<option value="'.$Access_Type.'">'.$Access_Type.'</option>';
	echo '<option value="Administrator">Administrator</option>';
			}
	    if($Access_Type=="Administrator")
		{echo '<option value="'.$Access_Type.'">'.$Access_Type.'</option>';
			echo '<option value="Teacher">Teacher</option>';
		}
	  }
	 /* else
	  {
	  echo '<option value="Select One">Select One</option>';
	   echo '<option value="Administrator">Administrator</option>';
	     echo '<option value="Teacher">Teacher</option>';
}*/?>
</select>
	  </td>
      <td>&nbsp;</td>
      </tr>
    <tr>
      <th height="29" scope="row">E-Mail: </th>
      <td>   <?php
	  if(!isset($_POST['Register']))
	  {
	  if(isset($E_mail))
	  
{
      echo "<input type='text' name='E_Mail' value='$E_mail' />";
}
}
	  
	   if(isset($_POST['Register']))
	  {
	 $E_M=$E_Mail;
	  if(isset($E_M))
	  
{
      echo "<input type='text' name='E_Mail' value='$E_M' />";
}
else
	  
{
      echo "<input type='text' name='E_Mail' />";
}
	  }
	  /*else
	  
{
      echo "<input type='text' name='E_Mail' />";
}
	  */?></td>
      <td>&nbsp;</td>
      </tr>
    

    <tr>
      <th height="24" scope="row">&nbsp;</th>
      <td>
	  
</td>
      <td>&nbsp;</td>
      </tr>
   
  </table>
  <br/>
   <a href="AccountSettings.php" class="reset">Reset |</a>
  <input name="Register" align="middle" type="submit" value="Register" />
 </form>
</div>
</div>

<div class="rightmenucre"> 
<h1>&nbsp;</h1><br />
<marquee direction="up" height="290"  style="marquee-speed:slow"><p align="center"><font color="#5555FF" id="f_si" face="Verdana, Geneva, sans-serif">Our system is protect your information.But you must sign out our system when you leave from this system.Then only that cause risk to your informations...</font>
</marquee></div>
 <?php
include_once "../footer.php";
}
?>
</body>
</html>